package com.lichuandi.controller;

import com.lichuandi.future.AsyncService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.CompletableFuture;

// 调用
@RestController
public class MyController {
    @Autowired
    private AsyncService service;

    @GetMapping("/async")
    public CompletableFuture<String> triggerAsync() {
        return service.asyncMethod();
    }
}
